@use "../variables.scss";

/*
  Styles for the default global modal go here.
  Specific modal styles should go in their own respective css files.
*/

.ReactModal__Overlay {
  background-color: rgba(50, 50, 50, 0.4) !important;
  z-index: 500;
  overflow: auto;

  .Modal {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid variables.$border-color;
    border-radius: 6px;
    padding: 0;
    margin: 0;
    outline: none;
    background: #ffffff;
    transform: translate(-50%, -50%);
    overflow: auto;

    &.DefaultSize {
      width: 100%;
      max-width: 400px;
    }

    &.SmallSize {
      width: 100%;
      max-width: 500px;
    }

    &.MediumSize {
      width: 100%;
      max-width: 700px;
    }

    &.MediumSizeExtra {
      width: 100%;
      max-width: 840px;
    }

    &.LargeSize {
      width: 100%;
      max-width: 960px;
    }

    &.FullSize {
      width: 100%;
      max-width: 100%;
      height: 100%;
    }

    &.ConfigureSnapshots {
      width: 100%;
      max-width: 570px;
    }

    &.PreflightModal {
      width: 100%;
      max-width: 533px;
    }

    &.DiffViewerModal {
      width: 90%;
      max-height: 90%;
      padding: 15px;

      .DiffOverlay {
        position: relative;
      }
    }

    &.UpgradeServiceModal {
      width: 90%;
      height: 90%;
    }

    &.ConfigureUpdatesModal {
      overflow: visible;
    }

    .Modal-header {
      padding: 20px 25px 0;
      margin: 0;
    }

    .Modal-header p {
      font-size: 20px;
      font-weight: 700;
      color: variables.$text-color-secondary;
      line-height: 34px;
      margin: 0;
    }

    .Modal-header.has-border {
      border-bottom: 1px solid variables.$border-color;
      padding-bottom: 18px;
    }

    .Modal-body {
      padding: 25px 25px;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }

    .Modal-header .subtitle {
      color: #9b9b9b;
      font-size: 14px;
      font-weight: 500;
    }

    .Modal-header h3 {
      font-size: 22px;
      color: #4a4a4a;
    }

    .subtitle {
      color: #9b9b9b;
      font-size: 14px;
      font-weight: 500;
    }
  }

  .ReactModal__Content.AddNewClusterModal--wrapper,
  .ReactModal__Content.SetUpAutoPRsModal--wrapper {
    overflow: visible;

    .Modal-body {
      overflow: visible;
    }
  }

  .u-modalPadding {
    padding: 25px;
  }
}

@media screen and (max-height: 43em) {
  .Modal {
    top: 60px;
    transform: translate(-50%, 0);
  }
}

.Title .step-number,
.Title.step-number {
  border-radius: 100%;
  width: 30px;
  height: 30px;
  display: inline-block;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 30px;
  color: variables.$nav-color;
  background-color: variables.$muted-light-accent;
}

.Title {
  font-weight: 700;
  font-size: 16px;
  line-height: 30px;
  color: #000;
}

.subtitle code {
  background-color: #4a4a4a;
  overflow: auto;
  color: #f8f8f2;
  text-align: left;
  white-space: pre-wrap;
  font-size: 12px;
  vertical-align: bottom;
}

.Modal-header h3 {
  font-size: 26px;
  font-weight: 500;
  color: #577981;
}

.Modal.helm pre {
  background-color: #4a4a4a;
}
